package org.nicocube.airain.domain.server.dao;

import javax.jdo.PersistenceManager;

public class PersistenceAccessor {
	private final PersistenceManager persistenceManager;

	public PersistenceAccessor(PersistenceManager persistenceManager) {
		this.persistenceManager = persistenceManager;
	}

	public <T> DomainQuery<T> newQuery(Class<T> clazz) {
		return new DomainQuery<T>(clazz,persistenceManager.newQuery(clazz));
	}
	
	public <T> T getObjectById(Class<T> arg0, Object arg1) {
		return persistenceManager.getObjectById(arg0, arg1);
	}

	public <T> T makePersistent(T arg0) {
		return persistenceManager.makePersistent(arg0);
	}

	public void deletePersistent(Object arg0) {
		persistenceManager.deletePersistent(arg0);
	}

	public void refresh(Object arg0) {
		persistenceManager.refresh(arg0);
	}	
	
	
}
